    <!DOCTYPE html>
        <html>
        <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <title>菜单管理</title>
        <meta name="viewport" content="initial-scale=1, maximum-scale=1">
        <link rel="shortcut icon" href="${ctx.getContextPath()}/imgs/favicon.ico">
        <meta name="apple-mobile-web-app-capable" content="yes">
        <meta name="apple-mobile-web-app-status-bar-style" content="black">
        <#include "${ctx.getContextPath()}/css.jsp" parse=true encoding="utf-8">
        </head>
        <body>
        <#include "${ctx.getContextPath()}/js.jsp" parse=true encoding="utf-8">
        <div class="page-group">
        <div class="page page-current">
        <header class="bar bar-nav">
        <a class="button button-link button-nav pull-left back external " href="${ctx.getContextPath()}/menu/index">
        <span class="icon icon-left"></span>
        返回
        </a>
        <h1 class="title">新增菜单</h1>
        </header>
        <div class="content">
        <div class="list-block">
        <from id="menuFrom" name="menuFrom" >
        <ul>
        <li>
        <div class="item-content">
        <div class="item-inner">
        <div class="item-title label">菜单名称</div>
        <div class="item-input">
        <input type="text" id="menuName" name="menuName" placeholder="请输入菜单名称">
        </div>
        </div>
        </div>
        </li>
        <li>
        <div class="item-content">
        <div class="item-inner">
        <div class="item-title label">所属上级</div>
        <div class="item-input">
        <select id="parentId" name="parentId">
        <option value="0">无</option>
        <#list menuList as menu>
        <option value="${menu.id}">${menu.menuName}</option>
        </#list>
        </select>
        </div>
        </div>
        </div>
        </li>
        <li>
        <div class="item-content">
        <div class="item-inner">
        <div class="item-title label">icon样式</div>
        <div class="item-input">
        <input type="text" id="iconStyle" name="iconStyle" placeholder="请输入菜单名称">
        </div>
        </div>
        </div>
        </li>
        <li>
        <div class="item-content">
        <div class="item-inner">
        <div class="item-title label">地址</div>
        <div class="item-input">
        <textarea id="httpUrl" name="httpUrl" placeholder="请输入连接地址"></textarea>
        </div>
        </div>
        </div>
        </li>
        <li>
        <div class="item-content">
        <span id="spanError" name="spanError" style="color: red;font-size: 18px;"></span>
        </div>
        </li>
        </ul>
        </from>
        </div>
        <div class="content-block">
        <div class="row">
        <div class="col-50"><a href="${ctx.getContextPath()}/menu/index" class="button button-big button-fill
        button-danger">返回</a></div>
        <div class="col-50"><a href="#" id="saveFormBtn" onclick="saveForm();" class="button button-big button-fill
        button-success">保存</a></div>
        </div>
        </div>
        </div>
        </div>
        </div>
        <script>
        function saveForm(){
        $.ajax({
        type: "POST",//方法类型
        dataType: "json",
        url: "${ctx.getContextPath()}/menu/add",
        data: {
            menuName:$("#menuName").val(),
            parentId:$("#parentId").val(),
            iconStyle:$("#iconStyle").val(),
            httpUrl:$("#httpUrl").val(),
            },
        success: function (result) {
        if (result.code == 200) {
        location.href="${ctx.getContextPath()}/home/index";
        } else {
        var msg = result.message;
        $("#spanError").text("ERROR：" + msg);
        }
        },
        error: function () {
        alert("系统异常！");
        }
        });
        }
        </script>
        </body>
        </html>